package com.house.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.house.mapper.HouseProductMapper;
import com.house.pojo.HouseProduct;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
/**
 * 22001011032刘晓妍
 */
public class HouseProductServiceImpl implements IHouseProductService {
    @Autowired
    private HouseProductMapper mapper;


    @Override
    public List<HouseProduct> list() {
        return mapper.selectList(new QueryWrapper<>());
    }

    @Override
    public HouseProduct getById(Integer id) {
        return mapper.selectById(id);
    }

    @Override
    public Integer add(HouseProduct houseProduct) {
        return mapper.insert(houseProduct);
    }

    @Override
    public Integer update(HouseProduct houseProduct) {
        return mapper.updateById(houseProduct);
    }

    @Override
    public Integer delete(Integer id) {
        return mapper.deleteById(id);
    }

}
